<!-- merchant 页面内容 -->
<section class="merchant" ng-controller="merchantCtrl">
    <div class="row user-page-top text-center">
        <img ng-src="{{ service_user.headimg.url }}?imageView2/1/w/200/h/200/interlace/1" class='img-circle' data-action="zoom">
        <p>{{ service_user.real_name }}</p>
        <!-- 用户、品牌商显示邮箱 -->
        <p>{{ service_user.email }}</p>
        <!-- 服务商显示接单数，评分数与星级 -->
        <p>
            <star len="service_user.raty"></star>
            <span>{{ service_user.orders_count }}单 好评 {{ service_user.raty | raty }}</span>
        </p>
    </div>
    <div class="container">
        <!-- <div class="row text-center pinpai-content">
            暂无介绍
          </div> -->
        <div class="row user-page-btns">
            <button class="btn btn-default yf-btn" ng-class="{'active': type == 1}" ng-click="setType(1);">他的订单</button>
            <!-- 服务商只显示他的评价这个部分 -->
            <button class="btn btn-default yf-btn" ng-class="{'active': type == 2}" ng-click="setType(2);">他的评价</button>
            <a class="back-btn pull-right" ng-click="goBack();"><span class="icon-left"></span>返回</a>
        </div>
        <!-- 订单列表 -->
        <div class="row orders-list" ng-show='type == 1'>
            <empty data='service_orders'></empty>
            <ul class="list-group">
                <li class="list-group-item yf-shadow" ng-repeat="order in service_orders track by $index">
                    <h4>{{ order.created_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</h4>
                    <p class="order-name">真实姓名：{{ order.name }}</p>
                    <p class="order-info">面积：{{order.square}}(㎡) | 品牌：{{ order.company_name }}</p>
                    <p class="order-address"><span class="glyphicon glyphicon-map-marker"></span>{{ order.address}}</p>
                </li>
            </ul>
        </div>
        <!-- 评价列表 -->
        <div class="row evaluates-list" ng-show='type == 2'>
            <empty data='service_comments'></empty>
            <table class="table" ng-show='service_comments && service_comments.length > 0'>
                <thead>
                    <th class="col-sm-4 col-xs-4">评价内容</th>
                    <th class="col-sm-2 col-xs-2">评分</th>
                    <th class="col-sm-2 col-xs-3">评价人</th>
                    <th class="col-sm-4 col-xs-3">订单信息</th>
                </thead>
                <tbody>
                    <tr ng-repeat="(key, comment) in service_comments track by key">
                        <td>
                            <p ng-if='comment.content'>{{ comment.content }}</p>
                            <p ng-if='!comment.content'>系统默认好评！</p>
                            <p class="time">{{ comment.updated_at * 1000 | date: 'yyyy-MM-dd HH:mm'}}</p>
                        </td>
                        <td>
                            <star len='comment.raty'></star>
                        </td>
                        <td>
                            {{ comment.customer_name }}
                        </td>
                        <td class="order-info">
                            <p>面积：{{order.square}}(㎡) | 品牌：{{ comment.order_info.company_name }}</p>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <nav ng-show="ispage">
            <ul class="pager pager-sm yf-pager">
                <li>
                    <a class="btn btn-default" ng-disabled="!((page.current_page - 1) >= 1)" ng-click="getNext(page.current_page - 1);">上一页</a>
                </li>
                <li>
                    <a class="btn btn-default" ng-disabled="!page.next_page" ng-click="getNext(page.next_page);">下一页</a>
                </li>
            </ul>
        </nav>
    </div>
</section>
